'''
Created on 2012-8-2

@author: xxy
'''

import ConfigParser

class Skill(object):
    def __init__(self, config_file):
        self.m_id = -1
        self.m_name = ''
        self.m_distance = 0
        self.m_is_aoe = False
        self.m_range = None
        self.m_cd = 0
        self.m_mp = 0
        self.m_phy_power = 0
        self.m_mag_power = 0
        #self.m_distance = 0
        self.__loadConfig(config_file)
        
    def __loadConfig(self, config_file):
        config = ConfigParser.ConfigParser()
        config.read(config_file)
        self.m_id = config.getint('SkillInfo', 'id')
        self.m_name = config.get('SkillInfo', 'name')
        self.m_is_aoe = eval(config.get('SkillInfo', 'is_aoe'))
        self.m_range = config.getint('SkillInfo', 'range')
        self.m_cd = config.getint('SkillInfo', 'cd')
        self.m_mp = config.getint('SkillInfo', 'mp')
        self.m_phy_power = config.getint('SkillInfo', 'phy_power')
        self.m_mag_power = config.getint('SkillInfo', 'mag_power')
        self.m_distance = config.getint('SkillInfo', 'distance')
        
    def getMp(self):
        return self.m_mp
    
    def getPhyPower(self):
        return self.m_phy_power
    
    def getMagPower(self):
        return self.m_mag_power
    
    def getDistance(self):
        return self.m_distance